﻿@page
@{ Layout = "_Layout"; }

<div style="height: 10px"></div>
<el-form v-on:submit.native.prevent :inline="true" :model="formInline" size="mini">
  <el-form-item label="时间：从">
    <el-date-picker
      v-model="formInline.dateFrom"
      type="date"
      value-format="yyyy-MM-ddTHH:mm:ss.000Z"
      placeholder="选择开始日期">
    </el-date-picker>
  </el-form-item>
  <el-form-item label="到">
    <el-date-picker
      v-model="formInline.dateTo"
      type="date"
      value-format="yyyy-MM-ddTHH:mm:ss.000Z"
      placeholder="选择结束日期">
    </el-date-picker>
  </el-form-item>
  <el-form-item label="类型">
    <el-select v-model="formInline.category" placeholder="请选择">
      <el-option label="<全部>" value=""></el-option>
      <el-option v-for="category in categories" :key="category.value" :label="category.label" :value="category.value"></el-option>
    </el-select>
  </el-form-item>
  <el-form-item label="来源">
    <el-select v-model="formInline.pluginId" placeholder="请选择">
      <el-option label="<全部>" value=""></el-option>
      <el-option v-for="pluginId in pluginIds" :key="pluginId.value" :label="pluginId.label" :value="pluginId.value"></el-option>
    </el-select>
  </el-form-item>
  <el-form-item label="关键字">
    <el-input v-model="formInline.keyword" placeholder="关键字"></el-input>
  </el-form-item>
  
  <el-form-item>
    <el-button type="primary" v-on:click="btnSearchClick">查询</el-button>
  </el-form-item>
</el-form>

<el-table
  :data="items"
  style="width: 100%">
  <el-table-column
    width="100"
    label="Id">
    <template slot-scope="scope">
      <el-link :underline="false" type="primary" v-on:click="btnLogView(scope.row.id)">{{scope.row.id}}</el-link>
    </template>
  </el-table-column>
  <el-table-column
    prop="createdDate"
    width="180"
    label="日期">
  </el-table-column>
  <el-table-column
    label="错误摘要">
    <template slot-scope="scope">
      <span v-html="scope.row.summary"></span>
    </template>
  </el-table-column>
  <el-table-column
    label="错误消息">
    <template slot-scope="scope">
      <span v-html="scope.row.message"></span>
    </template>
  </el-table-column>
</el-table>

<el-row style="margin: 10px">
  <el-col :span="24" align="center">
    <el-pagination
      v-on:current-change="handleCurrentChange"
      :current-page="formInline.currentPage"
      :page-size="formInline.limit"
      layout="total, prev, pager, next, jumper"
      :total="count">
    </el-pagination>
  </el-col>
</el-row>

<el-row>
  <el-divider></el-divider>
  <div style="height: 10px"></div>

  <el-button type="primary" size="small" v-on:click="btnExportClick">导出日志</el-button>
  <el-button type="primary" size="small" v-on:click="btnDeleteClick">清空日志</el-button>
  <div style="height: 10px"></div>
</el-row>

@section Scripts{
<script src="/sitefiles/assets/js/admin/settings/logsError.js" type="text/javascript"></script> }